lemmatizer is not working in CGI Python using lampp serevr
Hello, I am working on a simple lematization program. The program is effectively working on local machine with the terminal and python interpreter. but when i do the same program with CGI Python on my localhost web serevr LAMPP, it does not working. Tokenaizer is working perfectly but lematization is not working. Please help me.
My Code: ************************************** #!/usr/bin/python
from nltk.tokenize import sent_tokenize, word_tokenize, RegexpTokenizer from nltk.stem import WordNetLemmatizer
print "Content-type:text/htmlrnrn"
lemmatizer = WordNetLemmatizer() #Not working
text = "Appu is a better student in MCA, University campus, calicut university" print text
#RegexpTokenizer will work with ragular expression tokenizer = RegexpTokenizer('w+') words=tokenizer.tokenize(text)
for ws in words: print ws print '<br>'
#open file lemmaFile=open("lemmaFile.txt","w") #writing into file for w in words: lemmaFile.write(lemmatizer.lemmatize(w, pos="a")) #not Woking lemmaFile.write("t") Not Working